<template>
	<view class="uiwu">
		<uiwu-list :loading="more">
			<view class="uiwu-list">
				<view class="uiwu-list-item uiwu-flex-space" v-for="(item,index) in listData" :key="index">
					<!-- <image src="../../static/logo.png" mode="aspectFill"></image> -->
					<view class="in uiwu-flex-column">
						<text class="title">{{item.mark}}</text>
						<text class="time">{{item.add_time}}</text>
					</view>
					<view class="status" :class="item.pm == 1 ? 'active' : ''">{{item.pm == 1 ? '+' : '-'}}{{item.number}}</view>
				</view>
			</view>
		</uiwu-list>
		<!-- <view class="notedata uiwu-flex-column uiwu-flex-center">
			<image src="/static/notedata.png" mode="widthFix"></image>
			<text>最近7天内没有在此房间游戏</text>
			<view class="uiwu-flex-center">去抓零食</view>
		</view> -->
	</view>
</template>

<script setup lang="ts">
	import { onLoad , onNavigationBarButtonTap } from '@dcloudio/uni-app';
	import { inject, ref } from "vue";
	import { integrallist } from '@/api/api';
	import { uiwu } from '@/config/config';
	const listData = ref<Array<object>>([])
	const pageNum = ref<number>(1)
	const more = ref<string>('loading');
	const isLock = ref<boolean>(true)
	const getintegrallist = async (mack:boolean=false) : Promise<any> => {
		if(!mack) pageNum.value = 1
		const { data:{ data , total }} = await integrallist({
			page:pageNum.value
		})
		isLock.value = true
		uiwu.setlist({
			isMore:mack,
			listData,
			total,
			listRow:data,
			more,
			pageNum
		})
	}
	onNavigationBarButtonTap(()=>{
		uiwu.openWindow('/pages/pointsmall/rule')
	})
	onLoad(()=>{
		getintegrallist()
	})
</script>

<style lang="scss">
	page{
		background-color: #F6F6F6;
	}
	.uiwu{
		padding: 20rpx 0;
	}
	.uiwu-list{
		padding: 0 24rpx;
		background-color: #fff;
		&-item{
			padding: 24rpx 0;
			border-bottom: 1rpx solid #E6E6E6;
			&:last-child{
				border-bottom: 0;
			}
			image{
				width: 108rpx;
				height: 108rpx;
				border-radius: 16rpx;
			}
			.in{
				flex: 1;
				padding: 0 24rpx;
				.title{
					font-size: 28rpx;
					font-weight: 800;
					color: #231815;
				}
				.time{
					margin-top: 15rpx;
					font-size: 24rpx;
					font-weight: 300;
					color: #999999;
				}
			}
			.status{
				font-size: 28rpx;
				font-weight: 500;
				color: #EF821E;
				&.active{
					color: #5BB431;
				}
			}
		}
	}
	.notedata{
		width: 100%;
		height: 100vh;
		image{
			width: 220rpx;
		}
		text{
			font-size: 28rpx;
			font-weight: 500;
			color: #444444;
			margin-top: 10rpx;
		}
		view{
			width: 300rpx;
			height: 80rpx;
			background: #EF821E;
			border-radius: 40rpx;
			font-size: 32rpx;
			font-weight: bold;
			color: #FFFFFF;
			margin-top: 40rpx;
		}
	}
</style>
